﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Base.DataAccess.Common;

namespace Base.Business
{
    public class RoleBLL
    {
        private RoleDAL roleDal = new RoleDAL();

        public DataSet GetRole(string Language, int PageSize, int PageIndex, string Sort, string Dir, string RoleName)
        {
            return roleDal.GetRole(Language, PageSize, PageIndex, Sort, Dir, RoleName);
        }

        public bool AddRole(string Language, string RoleName, string Description)
        {
            return roleDal.AddRole(Language, RoleName, Description);
        }

        public DataTable GetRoleById(string Language, Guid Id)
        {
            return roleDal.GetRoleById(Language, Id);
        }

        public bool UpdateRole(string Language, Guid Id, string RoleName, string Description)
        {
            return roleDal.UpdateRole(Language, Id, RoleName, Description);
        }

        public bool DeleteRole(Guid Id)
        {
            return roleDal.DeleteRole(Id);
        }


        public DataTable GetMenuRole(string Language, Guid Id)
        {
            return roleDal.GetMenuRole(Language, Id);
        }

        public void AddRoleMenu(Guid RoleId, Guid MenuId)
        {
            roleDal.AddRoleMenu(RoleId, MenuId);
        }

        public void DeleteRoleMenu(Guid RoleId)
        {
            roleDal.DeleteRoleMenu(RoleId);
        }

        public DataTable GetUserRole(Guid RoleId)
        {
            return roleDal.GetUserRole(RoleId);
        }

        public DataTable GetUserNotInRole(Guid RoleId, string Employee)
        {
            return roleDal.GetUserNotInRole(RoleId,Employee);
        }

        public bool AddUserRole(Guid UserId, Guid RoleId)
        {
            return roleDal.AddUserRole(UserId,RoleId);
        }

        public bool DeleteUserRole(Guid UserId, Guid RoleId)
        {
            return roleDal.DeleteUserRole(UserId, RoleId);
        }
    }
}
